package jiejie.jianzhioffer;

public class offer10_2 {
    public static void main(String[] args) {

    }

    /**
     * 跳台阶
     * @param n
     * @return
     */
    public int numWays(int n) {
        if(n<0)
            return 0;
        if(n==0)
            return 1;
        int[] res=new int[n+1];
        res[0]=1;
        res[1]=1;
        for(int i=2; i<=n; i++){
            res[i]=res[i-1]+res[i-2];
            res[i]=res[i]%1000000007;
        }
        return res[n];
    }
}